package nmrworkflow.framework.functionwrappers.nmrpipe;

import nmrworkflow.framework.functionwrappers.Argument;
import nmrworkflow.framework.functionwrappers.Function;

public class NmrPipeSolWrapper extends BaseNmrPipeWrapper {
	
	public static enum LowPassShapes {BOXCAR, SINE, SINESQRD};
	private int filtLength;
	private LowPassShapes lowPassShape;
	private boolean poly;
	
	public NmrPipeSolWrapper() {
		filtLength = 16;
		lowPassShape = LowPassShapes.BOXCAR;
		poly = false;
	}
	
	public NmrPipeSolWrapper(int filtLength, LowPassShapes lowPassShape, boolean poly) {
		this.filtLength = filtLength;
		this.lowPassShape = lowPassShape;
		this.poly = poly;
	}
	

	@Override
	protected Function buildFunction() {
		Function sol = new Function("sol");
		sol.addArgument(new Argument("fl", filtLength));
		
		if(lowPassShape == LowPassShapes.SINE)
			sol.addArgument(new Argument("fs", 2));
		else if(lowPassShape == LowPassShapes.SINESQRD)
			sol.addArgument(new Argument("fs", 3));
		else
			sol.addArgument(new Argument("fs", 1));
		
		if(poly)
			sol.addArgument(new Argument("poly", ""));
		
		return sol;
	}

}
